package exception;

import java.util.Scanner;
public class AdminUser {
    private String name="xzd";
    private String password="123";
    public AdminUser(String name, String password) throws RuntimeException{
        if(!this.name.equals(name)){//String 类型不可以用==
            throw new NameException("名字错误！");
        }
        if(!this.password.equals(password)){
            throw new PasswordException("密码错误！");
        }
    }

    @Override
    public String toString() {
        return "AdminUser{" +
                "name='" + name + '\'' +
                ", password='" + password + '\'' +
                '}';
    }
}
